package cn.iocoder.devlop.module.annual.report.shouldknow.controller.app;

import cn.iocoder.devlop.framework.common.pojo.CommonResult;
import cn.iocoder.devlop.framework.common.pojo.PageResult;
import cn.iocoder.devlop.module.annual.report.shouldknow.controller.vo.ShouldKnowRespVO;
import cn.iocoder.devlop.module.annual.report.shouldknow.convert.ShouldKnowConvert;
import cn.iocoder.devlop.module.annual.report.shouldknow.dal.dataobject.ShouldKnowDO;
import cn.iocoder.devlop.module.annual.report.shouldknow.service.ShouldKnowService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.devlop.framework.common.pojo.CommonResult.success;

@Tag(name = "用户 APP - 填报须知")
@RestController
@RequestMapping("/annual/report/should-know")
@Validated
public class AppShouldKnowController {

    @Resource
    private ShouldKnowService shouldKnowService;

    @GetMapping("/get")
    @Operation(summary = "获得填报须知")
    @Parameter(name = "enttype", description = "主体类型", required = true, example = "07")
    public CommonResult<ShouldKnowRespVO> getShouldKnow(@RequestParam("enttype") String enttype) {
        ShouldKnowDO shouldKnow = shouldKnowService.getShouldKnow(enttype);
        return success(ShouldKnowConvert.INSTANCE.convert(shouldKnow));
    }
}
